package com.qd.common.panda.domain.entity.shop.product;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;


/**
 * 商品图片
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class ProductImgDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "ID不能为空", groups = UpdateGroup.class)
    @Size(max = 50, message = "ID长度不能超过{max}位", groups = UpdateGroup.class)
    private String id;
    /**
     * 名称
     */
    @Size(max = 100, message = "名称长度不能超过{max}位", groups = DefaultGroup.class)
    private String picName;
    /**
     * 路径
     */
    @Size(max = 200, message = "路径长度不能超过{max}位", groups = DefaultGroup.class)
    private String picPath;
    /**
     * 排序
     */
    private Integer idx;
    /**
     * 商品编号
     */
    @Size(max = 50, message = "商品编号长度不能超过{max}位", groups = DefaultGroup.class)
    private String productCode;
    /**
     * 附件ID，从文件上传接口获得
     */
    @NotBlank(message = "附件ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "附件ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String fileId;
    /**
     * 附件类型
     */
    @NotBlank(message = "附件类型不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "附件类型长度不能超过{max}位", groups = DefaultGroup.class)
    private String attachmentType;

    @Override
    public void freeData() {
        this.id = null;
        this.picName = null;
        this.picPath = null;
        this.idx = null;
        this.productCode = null;
        this.fileId = null;
        this.attachmentType = null;
        super.freeData();
    }
}
